package com.kbs.im.common.udp.sender;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioDatagramChannel;

/**
 * udp 发送者服务启动器
 *
 * @author zhangzhang
 */
public class UdpSenderBootStrap {

    private static final UdpSenderBootStrap INSTANCE = new UdpSenderBootStrap();

    private Bootstrap bootstrap = new Bootstrap();

    private NioEventLoopGroup workGroup = new NioEventLoopGroup();


    private void run() {
        bootstrap.group(workGroup)
                .channel(NioDatagramChannel.class)
                .handler(UdpSenderChannelInitializer.INSTANCE);
        bootstrap.bind(7776);
    }

    public static void main(String[] args) {
        UdpSenderBootStrap.INSTANCE.run();
    }

}
